package newmeeting;

import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;

public class Person{
	
	private String name;
	private String password;
	public final static String namePropertyComponent = "Name";
	public final static String passwordPropertyComponent = "Password";
	private PropertyChangeSupport pcs;
	
	public Person(){
		pcs = new PropertyChangeSupport(this);
	}
	
	public Person(String name, String password) {
		pcs = new PropertyChangeSupport(this);
		this.name = name;
		this.password = password;
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		String oldValue = this.name;
		this.name = name;
		pcs.firePropertyChange(namePropertyComponent, oldValue, name);
	}
	
	public String getPassword() {
		return password;
	}
	
	public void setPassword(String password) {
		String oldValue = this.password;
		this.password = password;
		pcs.firePropertyChange(passwordPropertyComponent, oldValue, password);
	}
	
	public void addPropertyChangeListener(PropertyChangeListener listener) {
		pcs.addPropertyChangeListener(listener);
	}
	
	public void removePropertyChangeListener(PropertyChangeListener listener){
		pcs.removePropertyChangeListener(listener);
	}

	public void propertyChange(PropertyChangeEvent evt) {
	}
	
}